
alter table [event] add FacebookId varchar(50)
alter table picture add FacebookId varchar(50)

/*
alter table picture add [order] int
SELECT * into #temp
			FROM Picture
			ORDER BY picture_code

DECLARE @id uniqueidentifier  
DECLARE db_cursor CURSOR FOR  
	SELECT Event_id 
	FROM [event]
	--WHERE Event_ID = '0199B915-8D6E-4ACF-9D72-31B5291E6A38'

OPEN db_cursor   
FETCH NEXT FROM db_cursor INTO @id   

WHILE @@FETCH_STATUS = 0   
BEGIN   

		UPDATE Picture
		SET [order] = sub.[rank]
		FROM 
		(Select Row_Number() OVER(ORDER BY picture_code) as [rank], *
			FROM #temp
			WHERE Event_ID = @id) as sub
		WHERE picture.Picture_code = sub.Picture_code
	
	FETCH NEXT FROM db_cursor INTO @id 
END   

CLOSE db_cursor   
DEALLOCATE db_cursor
*/